package com.family.menage.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.family.common.utils.PageUtils;
import com.family.common.utils.Query;

import com.family.menage.dao.DevelopersDao;
import com.family.menage.entity.DevelopersEntity;
import com.family.menage.service.DevelopersService;


@Service("developersService")
public class DevelopersServiceImpl extends ServiceImpl<DevelopersDao, DevelopersEntity> implements DevelopersService {

    @Autowired
    private DevelopersDao developersDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<DevelopersEntity> wrapper = new QueryWrapper<>();
        String name = (String) params.get("developersName");
        wrapper.like("developers_name",name);
        IPage<DevelopersEntity> page = this.page(
                new Query<DevelopersEntity>().getPage(params),
                wrapper
        );

        return new PageUtils(page);
    }

    @Override
    public List<DevelopersEntity> findAll(DevelopersEntity developersEntity) {

        return developersDao.findAll(developersEntity);
    }

}